<html>
  <head>
  <title>Disc Golf Scores</title>
  <link rel="stylesheet" type="text/css" href="../styles/web.css" />
  </head>
  <body>
  <div id="form">

<?php 
include 'round.php'; ?>

<form action="results.php" method="post">    
<center>
<table border="1">
  <tr>
    <td><b>Hole</b></td>

<?php

    $currentHole = 1;
    $round = new Round($_POST['course'], $_POST['holes'], $_POST['player1'], $_POST['player2'], $_POST['player3'], $_POST['player4']);
    
    // Hole number plus amount of results to input
      foreach ($round->getPlayerList() as $value) {
        echo '<td><b>' . $value . '</b></td>';
      }
    echo '</tr>';
    
    while ($currentHole <= $round->getTotalHoles()) {
      echo '<tr>';
      echo '<td><b>' . $currentHole . '</b></td>';
      
      foreach ($round->getPlayerList() as $value) {
?>
       <td><input type="text" class="result" name="<?php echo $currentHole; echo $value; ?>"></td> 
<?php      }
      
      echo '</tr>';
      $currentHole = ++$currentHole;
    }
    
?>  
</table>
<p>

<!-- Invisible fields to pass frontpage values -->
<input type="hidden" name="course" value="<?php echo $_POST['course']; ?>">
<input type="hidden" name="holes" value="<?php echo $_POST['holes']; ?>">
<input type="hidden" name="player1" value="<?php echo $_POST['player1']; ?>">
<input type="hidden" name="player2" value="<?php echo $_POST['player2']; ?>">
<input type="hidden" name="player3" value="<?php echo $_POST['player3']; ?>">
<input type="hidden" name="player4" value="<?php echo $_POST['player4']; ?>">

<input type="submit" class="button" value="Submit"/>
</form>

  <div id="links">
    Links
    <span> : </span>
    <a href="history.php">Previous rounds</a>
   </div>

  </div>
</body>  
</html>